package com.tbryant.test.designpattern.zenofdesignpattern.builder.definition;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author TBryant
 * @date 2021/10/29 16:14
 */
public class Director {
    private AbstractBuilder abstractBuilder1 = new Builder1();
    private AbstractBuilder abstractBuilder2 = new Builder2();

    public AbstractProduct getProduct1() {
        List<String> sequence = Lists.newArrayList();
        sequence.add("doSomething1");
        sequence.add("doSomething2");
        sequence.add("doSomething3");
        abstractBuilder1.setSequence(sequence);
        return abstractBuilder1.buildProduct();
    }

    public AbstractProduct getProduct2() {
        List<String> sequence = Lists.newArrayList();
        sequence.add("doSomething3");
        sequence.add("doSomething2");
        sequence.add("doSomething1");
        abstractBuilder2.setSequence(sequence);
        return abstractBuilder2.buildProduct();
    }
}
